package com.robooot.business_counter.dao;

import com.robooot.business_counter.entity.Config;
import com.robooot.business_counter.entity.Device;
import com.robooot.business_counter.entity.DeviceDoor;
import com.robooot.business_counter.entity.Store;
import com.robooot.business_counter.model.CheckVo;
import com.robooot.business_counter.model.DeviceVo;
import com.robooot.business_counter.model.StoreVo;
import com.robooot.business_counter.model.UserVo;
import net.sf.json.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StoreDao {

    Integer getPickupRecordCount(StoreVo storeVo);

    List<Store> getPickupRecordList(StoreVo storeVo);

    List<Store> getUserStoreList(UserVo userVo);

    List<Config> getAllConfig();

    List<Device> getDeviceDoor(DeviceVo deviceVo);

    List<JSONObject> getDeviceList();

    JSONObject getDevice(String deviceId);

    JSONObject getDeviceDoorStatus(@Param("deviceId") String deviceId, @Param("boxNumber") Integer boxNumber);

    String getDeviceState(String deviceId);

    JSONObject getUserInfo(String userId);

    JSONObject getStoreInfo(@Param("userPhone") String userPhone, @Param("number") Integer number,@Param("deviceId") String deviceId);

    void saveStore(@Param("sequence") String sequence, @Param("flashKeySn") String flashKeySn, @Param("id") String id,@Param("deviceState") String deviceState);

    void updateDeviceDoor(@Param("deviceId") String deviceId , @Param("number") Integer number);

    void saveStoreFlash(@Param("sequence") String sequence, @Param("id") String id,@Param("deviceState") String deviceState);

    JSONObject getStoreInfoTow(String sequence);

    JSONObject getDoorStatus(@Param("deviceId") String device_id, @Param("counterNumber") String counterNumber, @Param("deviceState") String device_state);

    List<JSONObject> findDeviceDoorStatus(String deviceId);

    void bagCheck(CheckVo checkVo);

    List<JSONObject> getDeviceDoorList();

    List<JSONObject> findDeviceDoor(@Param("counterNumber") String counterNumber, @Param("deviceId") String deviceId);

    String findDoorDeviceState(@Param("deviceId") String deviceId, @Param("boxNumber") int boxNumber);

    JSONObject getStoreInfoTwo(@Param("courierPhone") String courierPhone, @Param("counterNumber") int counterNumber, @Param("deviceId") String deviceId);

    void deleteStoreInfo(int id);

    void updateDoor(@Param("deviceId") String deviceId, @Param("boxNumber") int boxNumber);

    Integer getDeviceDoorCount(DeviceVo deviceVo);

    void updateBoxDoor(@Param("boxInfoNumber") Integer boxInfoNumber, @Param("status") String status, @Param("deviceId") String deviceId);

    List<DeviceDoor> getDeviceDoorJust(DeviceVo deviceVo);

    void updateStoreInfo(@Param("id") int id, @Param("name") String name, @Param("phone") String phone, @Param("status") String status);

    JSONObject getDeviceLocation(String deviceId);
}
